using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_oeGUarMap : EntityTypeConfiguration<so_oeGUar>
    {
        public so_oeGUarMap()
        {
            // Primary Key
            this.HasKey(t => new { t.sumfields, t.dimfields });

            // Properties
            this.Property(t => t.Guarantor__)
                .HasMaxLength(10);

            this.Property(t => t.Guarantor)
                .HasMaxLength(110);

            this.Property(t => t.Guarantor_cur)
                .HasMaxLength(5);

            this.Property(t => t.Document_Type)
                .HasMaxLength(16);

            this.Property(t => t.Bill_cur)
                .HasMaxLength(5);

            this.Property(t => t.batch)
                .HasMaxLength(8);

            this.Property(t => t.Note)
                .HasMaxLength(70);

            this.Property(t => t.patient__)
                .HasMaxLength(6);

            this.Property(t => t.Patient_Name)
                .HasMaxLength(80);

            this.Property(t => t.cardnumber)
                .HasMaxLength(50);

            this.Property(t => t.Insured_Name)
                .HasMaxLength(50);

            this.Property(t => t.Relation_Type)
                .HasMaxLength(50);

            this.Property(t => t.sumfields)
                .IsRequired()
                .HasMaxLength(46);

            this.Property(t => t.dimfields)
                .IsRequired()
                .HasMaxLength(21);

            // Table & Column Mappings
            this.ToTable("so_oeGUar");
            this.Property(t => t.Guarantor__).HasColumnName("Guarantor_#");
            this.Property(t => t.Guarantor).HasColumnName("Guarantor");
            this.Property(t => t.Guarantor_cur).HasColumnName("Guarantor_cur");
            this.Property(t => t.Date).HasColumnName("Date");
            this.Property(t => t.Document_Type).HasColumnName("Document_Type");
            this.Property(t => t.voucher).HasColumnName("voucher");
            this.Property(t => t.Number).HasColumnName("Number");
            this.Property(t => t.Bill_cur).HasColumnName("Bill_cur");
            this.Property(t => t.Bill_bal_Bill_cur).HasColumnName("Bill_bal_Bill_cur");
            this.Property(t => t.Bill_bal_Guar_cur).HasColumnName("Bill_bal_Guar_cur");
            this.Property(t => t.Bill_balance_b1).HasColumnName("Bill_balance_b1");
            this.Property(t => t.Bill_balance_b2).HasColumnName("Bill_balance_b2");
            this.Property(t => t.batch).HasColumnName("batch");
            this.Property(t => t.closed_out).HasColumnName("closed_out");
            this.Property(t => t.Note).HasColumnName("Note");
            this.Property(t => t.Document_id).HasColumnName("Document_id");
            this.Property(t => t.patient__).HasColumnName("patient_#");
            this.Property(t => t.Patient_Name).HasColumnName("Patient_Name");
            this.Property(t => t.Patient_Amount).HasColumnName("Patient_Amount");
            this.Property(t => t.cardnumber).HasColumnName("cardnumber");
            this.Property(t => t.Insured_Name).HasColumnName("Insured_Name");
            this.Property(t => t.Relation_Type).HasColumnName("Relation_Type");
            this.Property(t => t.Bill_amount).HasColumnName("Bill_amount");
            this.Property(t => t.discount_amount).HasColumnName("discount_amount");
            this.Property(t => t.sumfields).HasColumnName("sumfields");
            this.Property(t => t.dimfields).HasColumnName("dimfields");
        }
    }
}
